class App extends React.Component {
    state = {
        contentList:[],// 存放微博列表的状态
        pageSum:1,// 总页数
        pageNo:1,// 当前页
    }
    // 获取微博列表
    async getWeibo(pageNo=1,pageSize=10){
        const result = await this.$axios.get("/weibo",{
           params:{
               pageNo,
               pageSize
           }
        })
        this.setState({
            contentList:result.contentList,
            pageNo:result.pageNo,
            pageSum:result.pageSum

        })
    }
    componentDidMount(){
        this.getWeibo();
    }
    render() {
        return (
            <>
                <TakeComment getWeibo={this.getWeibo.bind(this)}/>
                <CommentOn  getWeibo={this.getWeibo.bind(this)} {...this.state}/>
            </>
        )
    }
}